


<?php
/**
 *
 *
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @package       app.View.Layouts
 * @since         CakePHP(tm) v 0.10.0.1076
 * @license       http://www.opensource.org/licenses/mit-license.php MIT License
 */

$cakeDescription = __d('cake_dev', 'Abc.vnu');
?>
<!DOCTYPE html>
<html>
<head>
	<?php echo $this->Html->charset(); ?>
	<title>
		<?php echo $cakeDescription ?>:
		<?php echo $title_for_layout; ?>
	</title>
	<?php
		echo $this->Html->meta('icon');

		// echo $this->Html->css('cake.generic');
		echo $this->Html->css('bootstrap');
		echo $this->Html->css('metro-bootstrap');
		echo $this->Html->css('metro-bootstrap-responsive');
		echo $this->Html->css('metro-customize');
		echo $this->Html->css('style');
		echo $this->Html->script('jquery.min');
		echo $this->Html->script('jquery.widget.min');
		echo $this->Html->script('metro.core');echo $this->Html->script('custom');

		echo $this->fetch('meta');
		echo $this->fetch('css');
		echo $this->fetch('script');
	?>
</head>
<body class="metro">
	<div id="menu-bar">
		<nav class="navigation-bar light">
            <nav class="navigation-bar-content">
                <a class="element comp-logo" href="#"><img src="https://www.chatwork.com/gateway.php?cmd=download_file&bin=1&file_id=9991214"/></a>
                <?php
	                echo '<span class="element-divider"></span>';
	                echo $this->Html->link('Home',array('controller'=>'posts','action'=>'index'), array('class' => 'element'));
	                if($logged_in):
	                echo '<span class="element-divider"></span>';
	                echo $this->Html->link('Add Post',array('controller'=>'posts','action'=>'add'), array('class' => 'element'));
	                echo '<span class="element-divider"></span>';

	                if($isAdmin) {
	                    echo $this->Html->link('User',array('controller'=>'users','action'=>'index'), array('class' => 'element'));
	                    '<span class="element-divider"></span>';
	                }

	                echo '<span class="element-divider place-right"></span>';
	                echo $this->Html->link('Logout',array('controller'=>'users','action'=>'logout'), array('class' => 'element place-right login-logout'));
				        echo '<span class="element-divider place-right"></span>';
	                echo '<div class="element place-right dropdown-wrap">';
		                echo '<a class="dropdown-toggle " href="#">Welcome, '.$isAuth['name'].'</a>';

		                echo '<ul class="dropdown-menu" data-role="dropdown">
		                	<li>'. $this->Html->link('Profile',array('controller'=>'users','action'=>'view', $isAuth['id'])) .'</li>
		                	<li class="divider"></li>
		                    <li>'. $this->Html->link('Edit Profile',array('controller'=>'users','action'=>'edit', $isAuth['id'])) .'</li>
		                </ul>';
	                echo '</div>';
            	else:
		            // echo $this->Html->link('Facebook Login', $fb_login_url, array('class' => 'element place-right')) ;
		            echo $this->Html->link('Login',array('controller'=>'users','action'=>'login'), array('class' => 'element place-right login-logout'));
            	endif; 
            	?>
            </nav>
        </nav>
	</div>
    </div>
	<div class="container">

			<?php echo $this->Session->flash(); ?>

			<?php echo $this->fetch('content'); ?>
	</div>
	<div id="footer">
		<p><i>Design by <b>hungnup</b></i> with <a href="http://cakephp.org/">Cakephp</a> | <a href="http://metroui.org.ua/">Metro UI CSS</a></p>
	</div>
	<?php //echo $this->element('sql_dump'); ?>
</body>
</html>